package com.gusha.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Entity
@Table(name="sys_enjoy")
@NamedQuery(name="SysEnjoy.findAll", query="SELECT s FROM SysEnjoy s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysEnjoy implements Serializable {
	
	private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    private BigInteger id;
    
    //共享名称
    @Column(name="en_name")
    private String enName;
    
    //共享描述
    @Column(name="en_desc")
    private String enDesc;
    
    //共享内容
    @Column(name="en_content")
    private String enContent;
    
    //更新时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="add_time")
    private Date addTime;
    
    //修改时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="update_time")
    private Date updateTime;
    
    //共享分类
    @Column(name="en_type")
    private BigInteger enType;
    
    //是否删除  0未删 1已删
    @Column(name="is_delete")
    private BigInteger isDelete;
    
    //共享图片
    @Column(name="en_path")
    private String enPath;
    
    //共享视频
    @Column(name="en_video")
    private String enVideo;
    
    //审核
    @Column(name="en_check")
    private String enCheck;
    
    //审核人
    @Column(name="is_check")
    private String isCheck;
    
    //共享人
    @Column(name="en_user")
    private String enUser;
    
    //价格
    @Transient
    private BigDecimal enPrice;
    
    //面积
    @Column(name="en_area")
    private BigInteger enArea;
    
    //重量
    @Column(name="en_heft")
    private String enHeft;
    
    //数量
    @Column(name="en_number")
    private String enNumber;
    
    //健康值
    @Column(name="en_health")
    private String enHealth;
    
    //所在省
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="en_province")
    private SysArea enProvince;
    
    //所在市
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="en_city")
    private SysArea enCity;
    
    //所在区
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="en_district")
    private SysArea enDistrict;
    
    //所在地址
    @Column(name="en_address")
    private String enAddress;
    
    
	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public String getEnDesc() {
		return enDesc;
	}

	public void setEnDesc(String enDesc) {
		this.enDesc = enDesc;
	}

	public String getEnContent() {
		return enContent;
	}

	public void setEnContent(String enContent) {
		this.enContent = enContent;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public BigInteger getEnType() {
		return enType;
	}

	public void setEnType(BigInteger enType) {
		this.enType = enType;
	}

	public BigInteger getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(BigInteger isDelete) {
		this.isDelete = isDelete;
	}

	public String getEnPath() {
		return enPath;
	}

	public void setEnPath(String enPath) {
		this.enPath = enPath;
	}

	public String getEnVideo() {
		return enVideo;
	}

	public void setEnVideo(String enVideo) {
		this.enVideo = enVideo;
	}

	public String getEnCheck() {
		return enCheck;
	}

	public void setEnCheck(String enCheck) {
		this.enCheck = enCheck;
	}

	public String getIsCheck() {
		return isCheck;
	}

	public void setIsCheck(String isCheck) {
		this.isCheck = isCheck;
	}

	public String getEnUser() {
		return enUser;
	}

	public void setEnUser(String enUser) {
		this.enUser = enUser;
	}

	public BigDecimal getEnPrice() {
		return enPrice;
	}

	public void setEnPrice(BigDecimal enPrice) {
		this.enPrice = enPrice;
	}

	public BigInteger getEnArea() {
		return enArea;
	}

	public void setEnArea(BigInteger enArea) {
		this.enArea = enArea;
	}

	public String getEnHeft() {
		return enHeft;
	}

	public void setEnHeft(String enHeft) {
		this.enHeft = enHeft;
	}

	public String getEnNumber() {
		return enNumber;
	}

	public void setEnNumber(String enNumber) {
		this.enNumber = enNumber;
	}

	public String getEnHealth() {
		return enHealth;
	}

	public void setEnHealth(String enHealth) {
		this.enHealth = enHealth;
	}
	public SysArea getEnProvince() {
		return enProvince;
	}

	public void setEnProvince(SysArea enProvince) {
		this.enProvince = enProvince;
	}

	public SysArea getEnCity() {
		return enCity;
	}

	public void setEnCity(SysArea enCity) {
		this.enCity = enCity;
	}

	public SysArea getEnDistrict() {
		return enDistrict;
	}

	public void setEnDistrict(SysArea enDistrict) {
		this.enDistrict = enDistrict;
	}

	public String getEnAddress() {
		return enAddress;
	}

	public void setEnAddress(String enAddress) {
		this.enAddress = enAddress;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
    
    
}
